package com.eastfair.home.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.home.enumeration.SupervisionItemQuestionTextBoxTypeEnum;
import com.eastfair.home.enumeration.SupervisionItemQuestionQuestionTypeEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 监督项管理问卷
 * </p>
 *
 * @author linan
 * @since 2022-12-10
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("hc_supervision_item_question")
@ApiModel(value = "SupervisionItemQuestion", description = "监督项管理问卷")
@AllArgsConstructor
public class SupervisionItemQuestion extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 监督项管理ID
     */
    @ApiModelProperty(value = "监督项管理ID")
    @TableField(value = "supervision_item_management_id")
    @Excel(name = "监督项管理ID")
    private Long supervisionItemManagementId;

    /**
     * 序号
     */
    @ApiModelProperty(value = "序号")
    @TableField(value = "sort")
    @Excel(name = "序号")
    private Integer sort;

    /**
     * 问题标题
     */
    @ApiModelProperty(value = "问题标题")
    @Size(max = 512, message = "问题标题长度不能超过512")
    @TableField(value = "title", condition = LIKE)
    @Excel(name = "问题标题")
    private String title;

    /**
     * 问题类型 #{ESSAY_QUESTION:问答题;SINGLE_CHOICE:单选题;MULTIPLE_CHOICE:多选题}
     */
    @ApiModelProperty(value = "问题类型 #{ESSAY_QUESTION:问答题;SINGLE_CHOICE:单选题;MULTIPLE_CHOICE:多选题}")
    @TableField(value = "question_type")
    @Excel(name = "问题类型 #{ESSAY_QUESTION:问答题;SINGLE_CHOICE:单选题;MULTIPLE_CHOICE:多选题}", replace = {"问答题_ESSAY_QUESTION", "单选题_SINGLE_CHOICE", "多选题_MULTIPLE_CHOICE",  "_null"})
    private SupervisionItemQuestionQuestionTypeEnum questionType;

    /**
     * 最小字数
     */
    @ApiModelProperty(value = "最小字数")
    @TableField(value = "min_wordage")
    @Excel(name = "最小字数")
    private Integer minWordage;

    /**
     * 最大字数
     */
    @ApiModelProperty(value = "最大字数")
    @TableField(value = "max_wordage")
    @Excel(name = "最大字数")
    private Integer maxWordage;

    /**
     * 文本框类型 #{SINGLE:单行;MULTIPLE:多行}
     */
    @ApiModelProperty(value = "文本框类型 #{SINGLE:单行;MULTIPLE:多行}")
    @TableField(value = "text_box_type")
    @Excel(name = "文本框类型 #{SINGLE:单行;MULTIPLE:多行}", replace = {"单行_SINGLE", "多行_MULTIPLE",  "_null"})
    private SupervisionItemQuestionTextBoxTypeEnum textBoxType;

    /**
     * 选项1
     */
    @ApiModelProperty(value = "选项1")
    @Size(max = 256, message = "选项1长度不能超过256")
    @TableField(value = "option_one", condition = LIKE)
    @Excel(name = "选项1")
    private String optionOne;

    /**
     * 选项1允许填空：1是；0否
     */
    @ApiModelProperty(value = "选项1允许填空：1是；0否")
    @TableField(value = "option_one_fill")
    @Excel(name = "选项1允许填空：1是；0否")
    private Integer optionOneFill;

    /**
     * 选项2
     */
    @ApiModelProperty(value = "选项2")
    @Size(max = 256, message = "选项2长度不能超过256")
    @TableField(value = "option_two", condition = LIKE)
    @Excel(name = "选项2")
    private String optionTwo;

    /**
     * 选项2允许填空：1是；0否
     */
    @ApiModelProperty(value = "选项2允许填空：1是；0否")
    @TableField(value = "option_two_fill")
    @Excel(name = "选项2允许填空：1是；0否")
    private Integer optionTwoFill;

    /**
     * 选项3
     */
    @ApiModelProperty(value = "选项3")
    @Size(max = 256, message = "选项3长度不能超过256")
    @TableField(value = "option_three", condition = LIKE)
    @Excel(name = "选项3")
    private String optionThree;

    /**
     * 选项3允许填空：1是；0否
     */
    @ApiModelProperty(value = "选项3允许填空：1是；0否")
    @TableField(value = "option_three_fill")
    @Excel(name = "选项3允许填空：1是；0否")
    private Integer optionThreeFill;

    /**
     * 选项4
     */
    @ApiModelProperty(value = "选项4")
    @Size(max = 256, message = "选项4长度不能超过256")
    @TableField(value = "option_four", condition = LIKE)
    @Excel(name = "选项4")
    private String optionFour;

    /**
     * 选项4允许填空：1是；0否
     */
    @ApiModelProperty(value = "选项4允许填空：1是；0否")
    @TableField(value = "option_four_fill")
    @Excel(name = "选项4允许填空：1是；0否")
    private Integer optionFourFill;

    /**
     * 选项5
     */
    @ApiModelProperty(value = "选项5")
    @Size(max = 256, message = "选项5长度不能超过256")
    @TableField(value = "option_five", condition = LIKE)
    @Excel(name = "选项5")
    private String optionFive;

    /**
     * 选项5允许填空：1是；0否
     */
    @ApiModelProperty(value = "选项5允许填空：1是；0否")
    @TableField(value = "option_five_fill")
    @Excel(name = "选项5允许填空：1是；0否")
    private Integer optionFiveFill;

    /**
     * 必答：1是；0否
     */
    @ApiModelProperty(value = "必答：1是；0否")
    @TableField(value = "required")
    @Excel(name = "必答：1是；0否")
    private Integer required;


    @Builder
    public SupervisionItemQuestion(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long supervisionItemManagementId, Integer sort, String title, SupervisionItemQuestionQuestionTypeEnum questionType, Integer minWordage, Integer maxWordage, 
                    SupervisionItemQuestionTextBoxTypeEnum textBoxType, String optionOne, Integer optionOneFill, String optionTwo, Integer optionTwoFill, String optionThree, 
                    Integer optionThreeFill, String optionFour, Integer optionFourFill, String optionFive, Integer optionFiveFill, Integer required) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.supervisionItemManagementId = supervisionItemManagementId;
        this.sort = sort;
        this.title = title;
        this.questionType = questionType;
        this.minWordage = minWordage;
        this.maxWordage = maxWordage;
        this.textBoxType = textBoxType;
        this.optionOne = optionOne;
        this.optionOneFill = optionOneFill;
        this.optionTwo = optionTwo;
        this.optionTwoFill = optionTwoFill;
        this.optionThree = optionThree;
        this.optionThreeFill = optionThreeFill;
        this.optionFour = optionFour;
        this.optionFourFill = optionFourFill;
        this.optionFive = optionFive;
        this.optionFiveFill = optionFiveFill;
        this.required = required;
    }

}
